package strategy.shop;

public abstract class Discount {

	protected double finalPrice;

	protected String desc;

	public Discount(String desc) {
		this.desc = desc;
	}

	abstract double discount(double price);

	public double getFinalPrice() {
		return finalPrice;
	}

	public void setFinalPrice(double finalPrice) {
		this.finalPrice = finalPrice;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

}

class Dis9Discount extends Discount {

	public Dis9Discount() {
		super("打9折");
	}

	@Override
	double discount(double price) {
		this.finalPrice = price * 0.9;
		return this.finalPrice;
	}

}

class Dis8Discount extends Discount {

	public Dis8Discount() {
		super("打8折");
	}

	@Override
	double discount(double price) {
		this.finalPrice = price * 0.8;
		return this.finalPrice;
	}

}

class NoneDiscount extends Discount {

	public NoneDiscount() {
		super("不打折");
	}

	@Override
	double discount(double price) {
		return price;
	}

}